/* global beforeAll, afterAll */
const { MiniProgram } = require('miniprogram-automator');

let miniProgram;

beforeAll(async () => {
  // 启动微信开发者工具
  miniProgram = await MiniProgram.launch({
    projectPath: process.cwd(), // 项目路径
    cliPath: 'D:\\微信web开发者工具\\cli.bat', // 微信开发者工具命令行路径
  });
});

afterAll(async () => {
  if (miniProgram) {
    await miniProgram.close();
  }
});

// 全局变量
global.miniProgram = miniProgram; 